﻿<Page x:Class="TimePunch.Metro.Wpf.Controls.Picker.ListPickerFullMode"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:AppBar="clr-namespace:TimePunch.Metro.Wpf.Controls.AppBar" xmlns:Resources="clr-namespace:TimePunch.Metro.Wpf.Resources"
      xmlns:textBox="clr-namespace:TimePunch.Metro.Wpf.Controls.TextBox" mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="ListPickerFullMode">

    <Grid>

        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Header -->
        <TextBlock Grid.Row="0" 
                   Name="Header"
            Text="{Binding FullModeHeader}" 
            Style="{StaticResource WinTextGroupHeaderStyle}" 
            Margin="{StaticResource WinMargin}"/>

        <TextBox
            Grid.Row="0" Grid.Column="1" Margin="12 12 72 12"
            BorderBrush="LightGray"
            BorderThickness="1"
            Text="{Binding Path=FilterText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged }"
            Visibility="{Binding UseFilterMethod, Converter={StaticResource BooleanToVisibilityConverter}}"
            Style="{StaticResource WinInputTextNormalStyle}"
            VerticalContentAlignment="Center"
            Name="FilterTextBox"
            />

        <!-- Content -->
        <ListBox Grid.Row="1" 
                 Grid.ColumnSpan="2"
                 ItemsSource="{Binding FilteredItemSource}" 
                 SelectedItem="{Binding SelectedItem, Mode=TwoWay}" 
                 BorderThickness="0"
                 ItemTemplate="{Binding FullModeItemTemplate}"
                 ItemContainerStyle="{StaticResource ListBoxContainerStyle}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 Margin="{StaticResource WinMargin}"
                 KeyUp="OnListBoxKeyUp"
                 MouseLeftButtonUp="OnSelectItem">
        </ListBox>

        <!-- Application Bar -->
        <AppBar:ApplicationBar 
                 Grid.ColumnSpan="2"
                 Grid.Row="2" 
                 Background="{StaticResource WinChromeBrush}">
            <AppBar:ApplicationBar.Icons>
                <AppBar:ApplicationBarIcon ImageSource="/TpMetroWpfLibrary;component/Images/appbar.check.png"
                                           Description="{x:Static Resources:CommonResources.Button_Ok}"
                                           Command="{Binding CheckCommand}"/>
                <AppBar:ApplicationBarIcon ImageSource="/TpMetroWpfLibrary;component/Images/appbar.cancel.png"
                                           Description="{x:Static Resources:CommonResources.Button_Cancel}"
                                           Command="{Binding CancelCommand}"/>
            </AppBar:ApplicationBar.Icons>
        </AppBar:ApplicationBar>
    </Grid>
</Page>
